import regeneratorRuntime from 'regenerator-runtime'

global.regeneratorRuntime = regeneratorRuntime

import util from './utils/util'

global.util =util;
import R from 'ramda'


global.R =R

const asyncWrap = fn =>(option = {}) =>new Promise((resolve) =>{
    let conf = {
        success:res => {
            console.log(res)
            resolve(res)

        }
    }

    wx[fn](R.merge(conf,options))
})

wx.getSystemInfoAsync = asyncWrap('getSysemInfo')
wx.loginAsync = asyncWrap('login')
wx.getUserInfoAsync = asyncWrap('getUserInfo')
wx.reqAsync = asyncWrap('request')
